<?php
ob_start();
require("configs.php");
require_once (PASTA_SMARTY . 'ConfigSmarty.class.php');
require_once(PASTA_SMARTY . "Funcoes.class.php");
require_once (PASTA_SMARTY . "Cryptografa.class.php");

class EncaminhaAjax {
 public function getObjSmarty() {
        if ($this->objSmarty == null)
            $this->objSmarty = ConfigSmarty::getConfigSmarty();
        return $this->objSmarty;
    }

    public function ajax() {
        $crypt = new Cryptografa();
        $classFunction = $crypt->decrypt($_GET["param"]);
        $classFunction = explode(":", $classFunction);
        require_once(PASTA_CLASSES . $classFunction[0] . ".class.php");
        $classe = new $classFunction[0];
        $classFunction = explode("&", $classFunction[1]);
        $funcao = $classFunction[0];
        unset($classFunction[0]);
        $arrayGet=Funcoes::organizaParamGet($classFunction);
        $classe->$funcao($_GET,self::getObjSmarty(),$arrayGet);
    }

}
$executa= new EncaminhaAjax();
$executa->ajax();

?>